/*
 * @Author: Neko
 * @Date: 2021-04-09 10:21:33
 * @LastEditTime: 2021-06-02 17:05:01
 * @LastEditors: Neko
 */
import Vue from 'vue'
import App from './App'

Vue.config.productionTip = false
App.mpType = 'app'

// 导入UI库
import uView from "uview-ui";
Vue.use(uView);

// #ifdef H5
import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)
// #endif

// vuex
import store from './store'

// 国际化
import i18n from 'i18n'
import {
	getRouteUrl
} from './util'

// 全局混入
Vue.mixin({
	onLoad() {
		this.setNavTitle()
		this.$store.commit('SET_DOMAIN')
	},
	onShow() {
		this.$store.commit('SET_DOMAIN')
	},
	methods: {
		// 顶部标题国际化
		setNavTitle() {
			const str = getRouteUrl()
			const title = this.$t('locales')[str]
			uni.setNavigationBarTitle({
				title
			})
		}
	}
})

import content from '@/components/layouts/content'
Vue.component('contents', content)

import storage from '@/util/storage'
Vue.prototype.$storage = storage

const app = new Vue({
	i18n,
	store,
	...App
})
app.$mount()
